/*
 *  SimpleNoteGenerator.h
 *  SoundController0002
 *
 *  Created by jiro on 10/09/20.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#pragma once

#include "SoundController.h"
#include "NoteInfo.h"

#include <vector>

namespace sc
{
	class SoundGenerator
	{
	private:

	public:
	
		/** @brief generate sound elements with sine sound table and sine dynamics table, 
			@remark this is recommended	*/
		static std::vector< const SoundElement32* > Generate( const std::vector< NoteInfo >& noteInfos );

		/** @brief generate sound element with sine sound table and sine dynamics table, 
			@remark this is recommended	*/
		static const SoundElement32* Generate( const NoteInfo& noteInfo );


		//	deprecated
		static const SoundElement32* GenerateWithDynamicsTable( 
			double noteFrequency, double noteLength, double adjuster = 1.0 );

		//	deprecated
		static const SoundElement32* GenerateWithDynamicsTable( 
			Note::MidiNumber number, double noteLength, double adjuster = 1.0 );

		//	deprecated
		static std::vector< const SoundElement32* > GenerateChordWithDynamicsTable( 
			const std::vector< Note::MidiNumber >& numbers, double noteLength, double singleNoteDynamics );

		//	deprecated
		static std::vector< const SoundElement32* > GenerateChordWithDynamicsTable( 
			const std::vector< Note::MidiNumber >& numbers, const std::vector< double >& noteLengths, const std::vector< double >& adjuster );


		static std::vector< const SoundElement32* > GenerateChordWithDynamicsTable( 
			const std::vector< double >& freqs, double noteLength, double adjuster );


		static std::vector< const SoundElement32* > GenerateChordWithDynamicsTable( 
			const std::vector< double >& freqs, const std::vector< double >& noteLengths, const std::vector< double >& adjuster );

		///	コードを生成する。音量テーブルはSineで固定
		static void GenerateChordWithSineDynamicsTable( const std::vector< NoteInfo >& noteInfos,
			std::vector< const SoundElement32* >& chord );


		//	deprecated
		static std::vector< const SoundElement32* > GenerateChord( 
			const std::vector< Note::MidiNumber >& numbers, double noteLength, double singleNoteDynamics );

		//	deprecated
		static std::vector< const SoundElement32* > GenerateChord( 
			const std::vector< Note::MidiNumber >& numbers, const std::vector< double >& noteLengths, const std::vector< double >& dynamics );

		//	deprecated
		static std::vector< const SoundElement32* > GenerateChord( 
			const std::vector< double >& freqs, double noteLength, double singleNoteDynamics );

		//	deprecated
		static std::vector< const SoundElement32* > GenerateChord( 
			const std::vector< double >& freqs, const std::vector< double >& noteLengths, const std::vector< double >& dynamics );

		//	deprecated
		static const SoundElement32* Generate( double noteFrequency, double noteLength, double maxDynamics );

		///	 deprecated 
		static const SoundElement32* Generate( Note::Id nodeId, int octaveNumber, double noteLength, double maxDynamics );

		///	 deprecated 
		static const SoundElement32* Generate( Note::MidiNumber number, double noteLength, double maxDynamics );

	};
}
